package com.hsp.demo_01;

import java.util.Scanner;

public class Demo_16 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String name = "";
        String password = "";
        boolean flag = true;
        int count = 3;
        while(flag){
            System.out.print("请输入账号：");
            name = scanner.next();
            System.out.print("请输入密码：");
            password = scanner.next();
            if("丁真".equals(name) && "666".equals(password)){
                flag = false;
                System.out.println("登录成功");
            }else{
                System.out.println("密码输入错误，还剩" + --count + "次机会");
                if(count == 0){
                    System.out.println("账号被锁，请联系管理员！");
                    break;
                }
            }
        }
        System.out.println("===结束===");
        return;
    }

    private void goToSum(){
        return;
    }
}
